//
//  QLOrderCommentVC.m
//  神约
//
//  Created by qlwl on 17/2/22.
//  Copyright © 2017年 qlwl. All rights reserved.
//

#import "QLOrderCommentVC.h"
#import "QLOrderCommentCell.h"
#import "UIView+FrameKIt.h"

@interface QLOrderCommentVC ()<UITableViewDelegate,UITableViewDataSource>

@end

@implementation QLOrderCommentVC
{
    float _cellHeight;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    _cellHeight = 1;
}

#pragma mark TabDelegate
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 2;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    if (section == 0) {
        return 1;
    }else if (section == 1){
        return 2;
    }
    return 0;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.section == 0) {
        QLCommentUserInfoCell * cell = [tableView dequeueReusableCellWithIdentifier:@"QLCommentUserInfoCell"];
        return cell;
    }else if (indexPath.section == 1){
        if (indexPath.row == 0) {
            QLOrderCommentCell * cell = [tableView dequeueReusableCellWithIdentifier:@"QLOrderCommentCell"];
            return cell;
        }else if (indexPath.row == 1){
            QLCommentGoodTypeCell * cell = [tableView dequeueReusableCellWithIdentifier:@"QLCommentGoodTypeCell"];
            cell.goodTypeArray = @[@"",@"",@"",@"",@""];
            _cellHeight = cell.f_height;
            
            return cell;
        }
    }
    return nil;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.section == 0) {
        return 66;
    }else if (indexPath.section == 1){
        if (indexPath.row == 0) {
            return 190;
        }else if (indexPath.row == 1){
            return _cellHeight;
        }
    }
    return 0;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    if (section == 0) {
        return 30;
    }else if (section == 1){
        return 30;
    }
    return 0;
}
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
    return @[@"对方信息",@"对Ta评价"][section];
}

@end
